//
//  CircularClipView.h
//  MasonryDemo
//
//  Created by 杨淑园 on 15/11/17.
//  Copyright © 2015年 yangshuyaun. All rights reserved.
//

#import <UIKit/UIKit.h>
@class YSHYClipViewController;
typedef enum{
    CIRCULARCLIP   = 0,   //圆形裁剪
    SQUARECLIP            //方形裁剪
    
}ClipType;

@protocol ClipViewControllerDelegate <NSObject>

-(void)ClipViewController:(YSHYClipViewController *)clipViewController FinishClipImage:(UIImage *)editImage;

@end



@interface YSHYClipViewController : BaseViewController<UIGestureRecognizerDelegate>
{
    UIImageView *_imageView;
    UIImage *_image;
    UIView * _overView;
    UIView * _imageViewScale;
    
    CGFloat lastScale;
}
@property (nonatomic, assign)CGFloat scaleRation;//图片缩放的最大倍数
@property (nonatomic, assign)CGFloat radius; //圆形裁剪框的半径
@property (nonatomic, assign)CGRect circularFrame;//裁剪框的frame
@property (nonatomic, assign)CGRect OriginalFrame;
@property (nonatomic, assign)CGRect currentFrame;


@property (nonatomic, assign)ClipType clipType;  //裁剪的形状
@property (nonatomic, strong)id<ClipViewControllerDelegate>delegate;

-(instancetype)initWithImage:(UIImage *)image;
@end
/*
 -(void)clipBtnSelected:(UIButton *)btn
 {
     UIImage *image=[self getSmallImage];
     FRQCroppedImageViewController *view=[[FRQCroppedImageViewController alloc] init];
     view.image=image;
     [self.navigationController pushViewController:view animated:YES];
 }
 self.title=@"Selected Image";
 
 UIButton * clipBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
 [clipBtn setTitle:@"Crop" forState:UIControlStateNormal];
 [clipBtn addTarget:self action:@selector(clipBtnSelected:) forControlEvents:UIControlEventTouchUpInside];
 [clipBtn setBackgroundColor:skUIColorFromRGB(0x44cd2c)];
 [clipBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
 [clipBtn skSetBoardRadius:5 Width:1 andBorderColor:[UIColor clearColor]];
 [clipBtn setFrame:CGRectMake((self.view.frame.size.width-192)/2, self.view.frame.size.height - 200, 192, 50)];
 [self.view addSubview:clipBtn];
 */
